package com.zys.exercise;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.function.IntFunction;

public class text6 {
    public static void main(String[] args) {
        ArrayList<Integer> list = new ArrayList<>();
        Collections.addAll(list,1,2,3);
//        list.stream().map(Integer::parseInt).forEach(s-> System.out.println(s));
        Integer[] integers = list.stream().toArray(new IntFunction<Integer[]>() {
            @Override
            public Integer[] apply(int value) {
                return new Integer[value];
            }
        });

        System.out.println(Arrays.toString(integers));
    }
}
